﻿using System.Windows.Documents;
using WpfApplication1;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;

namespace Admin_tests
{
    
    
    /// <summary>
    ///This is a test class for AnswerTest and is intended
    ///to contain all AnswerTest Unit Tests
    ///</summary>
    [TestClass()]
    public class AnswerTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for RemoveBogusAnswer
        ///</summary>
        [TestMethod()]
        public void RemoveBogusAnswerTest()
        {
            string answer = "Mads"; 
            Answer target = new Answer(answer);
            target.AddBogusAnswer("Mark");
            target.AddBogusAnswer("Michael");
            string bogusanswer = "Mark";
            string expected = "Michael";
            int i = 0;
            target.RemoveBogusAnswer(bogusanswer, i);
            Assert.AreEqual(target.GetBogusAnswers()[0], expected);
        }

        /// <summary>
        ///A test for GetBogusAnswers
        ///</summary>
        [TestMethod()]
        public void GetBogusAnswersTest()
        {
            string answer = "Mads"; // TODO: Initialize to an appropriate value
            Answer target = new Answer(answer); // TODO: Initialize to an appropriate value
            target.AddBogusAnswer("Mark");
            List<string> expected = new List<string>(); // TODO: Initialize to an appropriate value
            expected.Add("Mark");
            List<string> actual;
            actual = target.GetBogusAnswers();
            Assert.AreEqual(expected.Count, actual.Count);
            for (int i = 0; i < actual.Count; i++)
            {
                Assert.AreEqual(actual[i], expected[i]);
            }
        }

        /// <summary>
        ///A test for AddBogusAnswer
        ///</summary>
        [TestMethod()]
        public void AddBogusAnswerTest()
        {
            string answer = "Mads"; // TODO: Initialize to an appropriate value
            Answer target = new Answer(answer); // TODO: Initialize to an appropriate value
            string bogusanswer = "Mark"; // TODO: Initialize to an appropriate value
            target.AddBogusAnswer(bogusanswer);
            string expected = "Mark";
            Assert.AreEqual(target.GetBogusAnswers()[target.GetBogusAnswers().Count-1], expected);
        }

        /// <summary>
        ///A test for Answer Constructor
        ///</summary>
        [TestMethod()]
        public void AnswerConstructorTest()
        {
            string answer = "Mads"; // TODO: Initialize to an appropriate value
            Answer target = new Answer(answer);
            string expected = "Mads";
            Assert.AreEqual(target.Realanswer, expected);
            Assert.IsInstanceOfType(target.GetBogusAnswers(), typeof (List<String>));
        }
    }
}
